package jgdabc.controller;

import jgdabc.config.PoetryResult;
import jgdabc.utils.QiniuUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/qiniu")
public class QiniuController {
    @Autowired
    private QiniuUtil qiniuUtil;
    @GetMapping("/getUpToken")
    public PoetryResult<String> getUpToken(@RequestParam(value = "key") String key) {
        System.out.println("请求访问获取");
        String token = qiniuUtil.getToken(key);
        return PoetryResult.success(qiniuUtil.getToken(key));
    }


}
